﻿using System.Collections.Generic;
using System.Net.Sockets;

namespace SLSocketServer
{
    /// <summary>
    /// 对客户端 Socket 及其他相关信息做一个封装
    /// </summary>
    public class ClientWrapper
    {
        /// <summary>
        /// 客户端 Socket
        /// </summary>
        public Socket Socket { get; set; }

        private byte[] _buffer;
        /// <summary>
        /// 为该客户端 Socket 开辟的缓冲区
        /// </summary>
        public byte[] Buffer
        {
            get
            {
                if (_buffer == null)
                    _buffer = new byte[1024];

                return _buffer;
            }
        }
        public string UserName { get; set;}
    }
}
